import {percent} from './percent.js';
import axios from 'axios';

//获取按钮
let btns = document.querySelectorAll('button');

//绑定事件
btns[0].onclick = function(){
  //获取概率的结果
  if(percent(100)){
    alert('恭喜恭喜')
  }else{
    alert('下次一定~~~');
  }
}

btns[1].onclick = function(){
  axios.get('http://api.xiaohigh.com/goods').then(response => {
    console.log(response);
  })
}